<jsp:useBean id="userInfoMap" scope="request" class="java.util.HashMap"/>
<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
	<meta name="description" content="" />
	<meta name="author" content="" />
	<title>后台</title>
	<link href="${pageContext.request.contextPath}/admin/css/glyphicon.css" rel="stylesheet" />
	<link href="${pageContext.request.contextPath}/admin/css/styles.css" rel="stylesheet" />
	<script src="${pageContext.request.contextPath}/admin/js/all.js"></script>
</head>
<body class="sb-nav-fixed">
<%@ include file="include/head.jsp" %>
<div id="layoutSidenav">
	<%@ include file="include/nav.jsp" %>
	<div id="layoutSidenav_content">
		<div class="container-fluid px-4">
			<div class="card mb-4">
				<div class="card-header">
					<i class="fas fa-table me-1"></i>
					表格
				</div>
				<div class="card-body">
					<a href="${pageContext.request.contextPath}/admin/addUser.jsp">
						<button class="btn btn-primary">添加用户</button>
					</a><br><br>


					<table id="datatablesSimple">
						<thead>
						<tr>
							<th>学号</th>
							<th>姓名</th>
							<th>密码</th>
							<th>性别</th>
							<th>邮箱</th>
							<th>电话号码</th>
							<th>职位</th>
							<th>编辑</th>
						</tr>
						</thead>


						<tbody>

						<c:forEach items="${userInfo}" var="user"> <!-- 遍历 ArrayList -->
							<tr>
								<td>${user.userID}</td>
								<td>${user.name}</td>
								<td>${user.password}</td>
								<td>${user.sex}</td>
								<td>${user.mailbox}</td>
								<td>${user.phone}</td>
								<td>${user.role}</td>
								<td>
									<a href="${pageContext.request.contextPath}/EditUser?id=${user.userID}">
										<button type="button" class="btn btn-default">
											<i class="glyphicon glyphicon-pencil"></i> 修改
										</button>
									</a>
									<a href="${pageContext.request.contextPath}/deleteUser?id=${user.userID}" method="get">
										<button type="button" class="btn btn-default">
											<i class="glyphicon glyphicon-trash"></i> 删除
										</button>
									</a>
								</td>
							</tr>
						</c:forEach>

						</tbody>
					</table>
				</div>
			</div>
		</div>
		<%@ include file="include/foot.jsp" %>
	</div>
</div>
<script src="${pageContext.request.contextPath}/admin/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/admin/js/scripts.js"></script>
<script src="${pageContext.request.contextPath}/admin/js/simple-datatables@latest.js"></script>
<script src="${pageContext.request.contextPath}/admin/js/datatables-simple-demo.js"></script>

<script>

</script>


</body>
</html>
